package com.guochenglang.www.service;

import com.guochenglang.www.pojo.Comment;
import com.guochenglang.www.service.anotate.Affair;

import java.sql.SQLException;
import java.util.ArrayList;

/**
 * @author GuoChenglang
 */
public interface CommentService {

    /**
     * 进行评论
     *
     * @param comment 评论的信息
     * @return 执行主键
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     * @throws InstantiationException 实现的异常
     */
    @Affair
    int comment(Comment comment) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException;


    /**
     * 删除评论
     *
     * @param id 评论的id
     * @return 删除行数
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     */
    @Affair
    int deleteComment(Integer id) throws SQLException, InterruptedException, IllegalAccessException;

    /**
     * 获得具体评论信息
     *
     * @param conditions 获取条件
     * @return 评论列表
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     * @throws InstantiationException 实现异常
     */
    ArrayList<Comment> getComment(Comment conditions) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException;
}
